# -*- coding:utf-8 -*-


"""
=============================
this is a feibot product,
all rights reserved.
www.feibot.com
@author: Gu Tianyuan
@email: g@feibot.com
@time: ${DATE}:${TIME}
@product: ${PRODUCT_NAME}
=============================
"""

from . import configFileHandler
from . import systemConfig
import os

cf = configFileHandler.UserConfigHandler()
language = cf.read("language", "displayLanguage", "string", "chinese")
if language not in ['chinese', 'english', 'traditionalChinese', 'korean']:
    language = 'english'
l = configFileHandler.ConfigFileHandler(os.path.join(systemConfig.languageFilePath, language + "Config.ini"))


def lanFromFile():
    if not language:
        return 'english'
    else:
        return language


# 主页面：
mainPage_label31 = l.read('mainDialog', 'eventId')
mainPage_label32 = l.read('mainDialog', 'softwareV')
mainPage_label17 = l.read('mainDialog', 'position')
mainPage_label3 = l.read('mainDialog', 'dataInWait')
mainPage_label = l.read('mainDialog', 'localT')
mainPage_label5 = l.read('mainDialog', 'passedT')
mainPage_label15 = l.read('mainDialog', 'gunTime')
mainPage_label7 = l.read('mainDialog', 'ch1234')
mainPage_label23 = l.read('mainDialog', 'machineId')
mainPage_label9 = l.read('mainDialog', 'tagTotal')
mainPage_label11 = l.read('mainDialog', 'tagDiff')
mainPage_label13 = l.read('mainDialog', 'server')
mainPage_label27 = l.read('mainDialog', 'ch5678')
mainPage_label21 = l.read('mainDialog', 'batLife')
mainPage_gunButton = l.read('mainDialog', 'gunButton')
mainPage_gunStopButton = l.read('mainDialog', 'gunReset')
mainPage_configButton = l.read('mainDialog', 'configButton')
mainPage_resetDataButton = l.read('mainDialog', 'resetDataButton')
mainPage_label25_max = l.read('mainDialog', 'max')
mainPage_label25_min = l.read('mainDialog', 'min')
mainPage_label14_connected = l.read('mainDialog', 'connected')
mainPage_label14_connectedWithoutServer = l.read('mainDialog', 'connectedWithoutServer')
mainPage_label14_disconnected = l.read('mainDialog', 'disconnected')
mainPage_reading = l.read('mainDialog', 'reading')
mainPage_stopReading = l.read('mainDialog', 'stopReading')
mainPage_stopReadingBtn = l.read('mainDialog', 'stopReadingBtn')
mainPage_TestMode = l.read('mainDialog', 'testMode')
mainPage_releaseMode = l.read('mainDialog', 'releaseMode')
mainPage_reader = l.read('mainDialog', 'reader')
mainPage_diskSpace1 = l.read('mainDialog', 'diskSpace1')
mainPage_diskSpace2 = l.read('mainDialog', 'diskSpace2')
mainPage_newSoftware = l.read('mainDialog', 'newSoftware')
mainPage_newFirmware = l.read('mainDialog', 'newFirmware')
mainPage_dataFileUploadSuccessful = l.read('mainDialog', 'dataFileUploadSuccessful')
mainPage_dataFileUploadFailed = l.read('mainDialog', 'dataFileUploadFailed')
mainPage_warning = l.read('mainDialog','warning')
mainPage_devWarning = l.read('mainDialog','devWarning')
mainPage_newSoftwareWarning = l.read('mainDialog','newSoftwareWarning')
mainPage_timeDiffWarning = l.read('mainDialog','timeDiffWarning')
mainPage_activeChannel = l.read('mainDialog','activeChannel')
mainPage_activeNoActivating =l.read('mainDialog','activeNoActivating')
mainPage_activeActivating = l.read('mainDialog','activeActivating')
mainPage_displayChannels = l.read('mainDialog','displayChannels')
mainPage_displayLog = l.read('mainDialog','displayLog')
mainPage_GMWorkingChannels = l.read('mainDialog','GMWorkingChannels')
mainPage_active = l.read('mainDialog','active')
mainPage_passive = l.read('mainDialog','passive')
mainPage_setPassive = l.read('mainDialog', 'passiveText')
mainPage_setActive = l.read('mainDialog', 'activeText')
mainPage_OK = l.read('mainDialog', 'OK')
mainPage_cancel = l.read('mainDialog', 'cancel')
mainPage_startReading = l.read('mainDialog', 'startReading')

config_event = l.read('config', 'event')
config_machine = l.read('config', 'machine')
config_functions = l.read('config', 'functions')
config_about = l.read('config', 'about')
config_shutDown = l.read('config','shutDown')
config_return = l.read('config', 'return')

eventSetting_eventId = l.read('eventSetting', 'eventId')
eventSetting_eventName = l.read('eventSetting', 'eventName')
eventSetting_machinePosition = l.read('eventSetting', 'machinePosition')
eventSetting_configFile = l.read('eventSetting', 'configFile')
eventSetting_recordFile = l.read('eventSetting', 'recordFile')
eventSetting_readConfigFileFromDisk = l.read('eventSetting', 'readConfigFileFromDisk')
eventSetting_downLoadConfigFile = l.read('eventSetting', 'downLoadConfigFile')
eventSetting_uploadFile = l.read('eventSetting', 'uploadFile')
eventSetting_back = l.read('eventSetting', 'back')
eventSetting_deleteDataFile = l.read('eventSetting', 'deleteDataFile')
eventSetting_exportAllData = l.read('eventSetting','exportAllData')
eventSetting_exportThisData = l.read('eventSetting','exportThisData')
eventSetting_setRaceNumber = l.read('eventSetting','setRaceNumber')
eventSetting_pushButton_Confirm = l.read('eventSetting','pushButton_Confirm')
eventSetting_pushButton_Cancel = l.read('eventSetting','pushButton_Cancel')
eventSetting_Edit_input = l.read('eventSetting','Edit_input')
eventSetting_label=l.read('eventSetting','label')

configMachine_passiveSystem = l.read('configMachine', 'passiveSystem')
configMachine_activeSystem = l.read('configMachine','activeSystem')
configMachine_timeDateSetting = l.read('configMachine', 'timeDateSetting')
configMachine_networkSetting = l.read('configMachine', 'networkSetting')
configMachine_softwareUpdate = l.read('configMachine', 'softwareUpdate')
configMachine_settings = l.read('configMachine','settings')
configMachine_advancedSetting = l.read('configMachine', 'advancedSetting')
configMachine_back = l.read('configMachine', 'back')

operate_reader = l.read('operate', 'reader')
operate_start = l.read('operate', 'start')
operate_stop = l.read('operate', 'stop')
operate_reboot = l.read('operate', 'reboot')
operate_setup = l.read('operate', 'setup')
operate_allowEpcBoxTitle = l.read('operate', 'allowEpcBoxTitle')
operate_byte = l.read('operate', 'byte')
operate_fanOn = l.read('operate', 'fanOn')
operate_fanOff = l.read('operate', 'fanOff')
operate_powerOff = l.read('operate', 'powerOff')
operate_back = l.read('operate', 'back')

activeSetting_lowFreq1 = l.read('activeSetting','lowFreq1')
activeSetting_lowFreq2 = l.read('activeSetting','lowFreq2')
activeSetting_lowFreqOn = l.read('activeSetting','lowFreqOn')
activeSetting_lowFreqOff = l.read('activeSetting','lowFreqOff')
activeSetting_activePower = l.read('activeSetting','activePower')
activeSetting_channel = l.read('activeSetting','channel')
activeSetting_set = l.read('activeSetting','set')
activeSetting_fanOn = l.read('activeSetting','fanOn')
activeSetting_fanOff = l.read('activeSetting','fanOff')
activeSetting_powerOff = l.read('activeSetting','powerOff')
activeSetting_back = l.read('activeSetting','back')
activeSetting_rebootActive = l.read('activeSetting','rebootActive')

about_softwareVersion = l.read('about', 'softwareVersion')
about_firmwareVersion = l.read('about', 'firmwareVersion')
about_testMode = l.read('about', 'testMode')
about_normalMode = l.read('about', 'normalMode')
about_back = l.read('about', 'back')

timeSetting_year = l.read('timeSetting', 'year')
timeSetting_month = l.read('timeSetting', 'month')
timeSetting_day = l.read('timeSetting', 'day')
timeSetting_hour = l.read('timeSetting', 'hour')
timeSetting_minute = l.read('timeSetting', 'minute')
timeSetting_second = l.read('timeSetting', 'second')
timeSetting_ntpTime = l.read('timeSetting', 'ntpTime')
timeSetting_setNtpTime = l.read('timeSetting', 'setNtpTime')
timeSetting_wirelessTimeSynch = l.read('timeSetting', 'wirelessTimeSynch')
timeSetting_modifyTime = l.read('timeSetting', 'modifyTime')
timeSetting_setTime = l.read('timeSetting', 'setTime')
timeSetting_setDate = l.read('timeSetting', 'setDate')
timeSetting_back = l.read('timeSetting', 'back')
timeSetting_send = l.read('timeSetting', 'send')
timeSetting_receive = l.read('timeSetting', 'receive')
timeSetting_wirelessTimeSignal = l.read('timeSetting', 'wirelessTimeSignal')
timeSetting_synchNtptime = l.read('timeSetting','synchNtpTime')
timeSetting_setLinuxTime = l.read('timeSetting', 'setLinuxTime')
timeSetting_confirm = l.read('timeSetting','confirm')
timeSetting_text = l.read('timeSetting','text')
timeSetting_OK = l.read('timeSetting','OK')
timeSetting_cancel = l.read('timeSetting','cancel')

networkSetting_protocol = l.read('networkSetting','protocol')
networkSetting_ipAddress = l.read('networkSetting', 'ipAddress')
networkSetting_udpTarget = l.read('networkSetting', 'udpTarget')
networkSetting_targetIp = l.read('networkSetting', 'targetIp')
networkSetting_targetPort = l.read('networkSetting', 'targetPort')
networkSetting_set = l.read('networkSetting', 'set')
networkSetting_back = l.read('networkSetting', 'back')
networkSetting_connected = l.read('networkSetting', 'connected')
networkSetting_disconnected = l.read('networkSetting', 'disconnected')
networkSetting_connectInfo = l.read('networkSetting','connectInfo')

softwareUpdate_select = l.read('softwareUpdate', 'select')
softwareUpdate_write = l.read('softwareUpdate', 'write')
softwareUpdate_back = l.read('softwareUpdate', 'back')

shutDown_info = l.read('shutDown', 'info')
shutDown_powerOff = l.read('shutDown', 'powerOff')
shutDown_reboot = l.read('shutDown', 'reboot')
shutDown_back = l.read('shutDown', 'back')

readerSetting_reader = l.read('readerSetting', 'reader')
readerSetting_setPower = l.read('readerSetting', 'setPower')
readerSetting_getPower = l.read('readerSetting', 'getPower')
readerSetting_band = l.read('readerSetting', 'band')
readerSetting_setFreq = l.read('readerSetting', 'setFreq')
readerSetting_getFreq = l.read('readerSetting', 'getFreq')
readerSetting_type = l.read('readerSetting','type')
readerSetting_getType = l.read('readerSetting','getType')
readerSetting_setType = l.read('readerSetting','setType')
readerSetting_back = l.read('readerSetting', 'back')
readerSetting_readerTypeA = l.read('readerSetting','readerTypeA')
readerSetting_readerTypeB1 = l.read('readerSetting','readerTypeB1')
readerSetting_readerTypeB2 = l.read('readerSetting','readerTypeB2')
readerSetting_readerTypeC = l.read('readerSetting','readerTypeC')
readerSetting_readerTypeD = l.read('readerSetting','readerTypeD')

settings_settings = l.read('settings','settings')
settings_beeper = l.read('settings','beeper')
settings_enabled = l.read('settings','enabled')
settings_disabled = l.read('settings','disabled')
settings_newRecordFile = l.read('settings','newRecordFile')
settings_create = l.read('settings','create')
settings_back = l.read('settings','back')
settings_active = l.read('settings','active')
settings_passive = l.read('settings','passive')

advancedSetting_info = l.read('advancedSetting', 'info')
advancedSetting_configItem = l.read('advancedSetting', 'configItem')
advancedSetting_value = l.read('advancedSetting', 'value')
advancedSetting_set = l.read('advancedSetting', 'set')
advancedSetting_setDefault = l.read('advancedSetting', 'setDefault')
advancedSetting_back = l.read('advancedSetting', 'back')
advancedSetting_wrongValue = l.read('advancedSetting','wrongValue')

logDialog_name = l.read('logDialog','name')
logDialog_upload = l.read('logDialog','upload')
logDialog_uploadRecently = l.read('logDialog','uploadRecently')
logDialog_delete = l.read('logDialog','delete')
logDialog_logSizeInfo = l.read('logDialog','logSizeInfo')
logDialog_recentLogSizeInfo = l.read('logDialog','recentLogSizeInfo')
logDialog_logFileDeletedNum = l.read('logDialog','logFileDeletedNum')
logDialog_uploadResultInfo = l.read('logDialog','uploadResultInfo')


wifi_connect = l.read('wifi', 'connect')
wifi_back = l.read('wifi', 'back')
wifi_refresh = l.read('wifi','refresh')
wifi_confirm = l.read('wifi', 'confirm')
wifi_cancel = l.read('wifi', 'cancel')
wifi_connecting_dialog = l.read('wifi', 'connectingdialog')
wifi_static_ip_and_dhcp = l.read('wifi', 'staticipandDHCP')
wifi_exit_setting = l.read('wifi', 'exitseting')
wifi_set_to_dhcp = l.read('wifi', 'settoDHCP')
wifi_set_to_static_ip = l.read('wifi', 'settoStaticIP')
wifi_current_wifi = l.read('wifi', 'currentwifi')
wifi_mask = l.read('wifi', 'mask')
wifi_gateway = l.read('wifi', 'gateway')
wifi_display_set_dhcp_success = l.read('wifi', 'display_setDHCPSuccess')
wifi_display_set_dhcp_failed = l.read('wifi', 'display_setDHCPFailed')
wifi_display_set_static_ip_success = l.read('wifi', 'display_setStaticIPSuccess')
wifi_display_set_static_ip_failed = l.read('wifi', 'display_setStaticIPFailed')


